package com.docker.sys.dept;

import com.docker.core.constant.APPIDConstant;
import com.docker.core.mvc.APPID;
import com.docker.core.mvc.Remark;
import com.docker.core.mvc.controller.BaseAPIController;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Okv;

/**
 * @Author ldl
 * @Create 2020/11/24 024 15:34
 */
@Remark("部门管理")
@APPID(APPIDConstant.dum_web)
public class DeptController extends BaseAPIController {

    @Inject
    private DeptService deptService;

    /**
     * @Param: []
     * @return: TODO
     * @Author: ldl
     * @Create: 2020/11/24 024 16:08
     */
    @Remark("部门组织架构")
    public void list() {
        Okv cond = Okv.create();
        renderAPISuccess(deptService.list(Okv.by("cond", cond)));
    }

    /**
     * @Param: []
     * @return: TODO
     * @Author: ldl
     * @Create: 2020/11/24 024 16:16
     */
    @Remark("添加部门")
    public void save() {
        renderAPI(deptService.save(getBean(DeptBean.class, "")));
    }

    /**
     * @Param: []
     * @return: TODO
     * @Author: ldl
     * @Create: 2020/11/24 024 16:25
     */
    @Remark("修改部门")
    public void update() {
        renderAPI(deptService.update(getBean(DeptBean.class, "")));
    }

}
